<?php
class Tgiachidoan extends AppModel {
	var $name = 'Tgiachidoan';
	var $validate = array(
		'chidoansv_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'sinhvien_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'ghichu' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Chidoansv' => array(
			'className' => 'Chidoansv',
			'foreignKey' => 'chidoansv_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Sinhvien' => array(
			'className' => 'Sinhvien',
			'foreignKey' => 'sinhvien_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	public function generatequery($options = null)
	{ 
        $fields = array();
        $dbo = $this->getDataSource(); 
        $default = array( 
            'fields' => $fields, 
            'table' => $dbo->fullTableName($this), 
            'alias' => 'Tgiachidoan', 
            'limit' => null, 
            'offset' => null, 
            'joins' => array(), 
            'conditions' => array(), 
            'order' => null, 
            'group' => null 
        ); 
        $params = array_merge($default, $options);
        $subQuery = $dbo->buildStatement($params, $this); 
         
        return $subQuery; 
    }
}
